<div class="container-fluid">
    <div class="block-header">
        <h2>功能管理 > 活动</h2>
    </div>
    <!-- Vertical Layout -->
    <div class="row">
        <div class="col-lg-12 col-md-12">
            <div class="card">
                <div class="header">
                    <h2>管理活动</h2>
                </div>
                <div class="body">
                   <input type="hidden" id="hash_id" name="hash_id" value="<?php echo Wo_CreateSession();?>">
                   <div class="clearfix"></div>
                   <div class="table-responsive1">
                        <table class="table table-bordered table-striped table-hover">
                            <thead>
                                <tr>
                                      <th>ID</th>
					                  <th>链接</th>
					                  <th>作者</th>
					                  <th>发布</th>
					                  <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                               <?php 
				               foreach (Wo_GetEvents(array('is_admin' => 1, "limit" => 900000)) as $wo['event']) {
				                  echo Wo_LoadAdminPage('manage-events/list');
				                }
				               ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
    <!-- #END# Vertical Layout -->
<div class="modal fade" id="delete-event">
   <div class="modal-dialog">
      <div class="modal-content modal-col-red">
         <div class="modal-header">
            <h4 class="modal-title"><i class="fa fa-exclamation-circle"></i>
               删除
            </h4>
         </div>
         <div class="modal-body">
            <p>您确定要删除此活动吗？</p>
         </div>
         <div class="modal-footer">
            <button  type="button" onclick="Wo_DeleteEvent($('#delete-event').attr('data-event-ident'))" class="btn btn-link">删除</button>
            <button  type="button" class="btn btn-link" data-dismiss="modal">取消</button>
         </div>
      </div>
   </div>
</div>
<script>
$(function () {
	$('table').DataTable();
});

jQuery(document).ready(function($) {
   $(document).on('click', ".delete-event", function(event) {
      $("#delete-event").attr('data-event-ident', $(this).attr('id')).modal('show');

  });
});

function Wo_DeleteEvent(id) {
  if (!id) {
   return false;
  }

  else{
       $('#EventID_' + id).fadeOut(300, function() {
           $(this).remove();
         });
       $("#delete-event").modal('hide');
      $.get(Wo_Ajax_Requests_File(),{f:'delete-event',id: id});
  }
  
}
</script>